//package com.example.ufollocloudemail;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import org.apache.http.NameValuePair;
//import org.apache.http.message.BasicNameValuePair;
//import org.json.JSONException;
//import org.json.JSONObject;
//
//import android.app.Activity;
//import android.app.ProgressDialog;
//import android.content.Intent;
//import android.os.AsyncTask;
//import android.os.Bundle;
//import android.util.Log;
//import android.view.View;
//import android.widget.Button;
//import android.widget.EditText;
//import androidhive.dashboard.R;
//
//public class NewSedaTeamProposalActivity extends Activity {
//
//	// Progress Dialog
//	private ProgressDialog pDialog;
//
//	JSONParser jsonParser = new JSONParser();
//	EditText inputEmailAddress;
//	EditText inputMessage;
//
//	// url to create new product
//	private static String url_send_message = "http://i-com.co.ug//ufollo/insert_multiple.php";
//
//	// JSON Node names
//	private static final String TAG_SUCCESS = "success";
//
//	@Override
//	public void onCreate(Bundle savedInstanceState) {
//		super.onCreate(savedInstanceState);
//		setContentView(R.layout.add_emails);
//
//		// Edit Text
//		inputEmailAddress = (EditText) findViewById(R.id.inputName);	
//		inputMessage = (EditText) findViewById(R.id.inputDesc);
//
//		// Create button
//		Button btnCreateProduct = (Button) findViewById(R.id.btnCreateProduct);
//
//		// button click event
//		btnCreateProduct.setOnClickListener(new View.OnClickListener() {
//
//			@Override
//			public void onClick(View view) {
//				// creating new product in background thread
//				new CreateNewEmail().execute();
//			}
//		});
//	}
//
//	/**
//	 * Background Async Task to Create new product
//	 * */
//	class CreateNewEmail extends AsyncTask<String, String, String> {
//
//		/**
//		 * Before starting background thread Show Progress Dialog
//		 * */
//		@Override
//		protected void onPreExecute() {
//			super.onPreExecute();
//			pDialog = new ProgressDialog(NewSedaTeamProposalActivity.this);
//			pDialog.setMessage("Sending Message..");
//			pDialog.setIndeterminate(false);
//			pDialog.setCancelable(true);
//			pDialog.show();
//		}
//
//		/**
//		 * Creating product
//		 * */
//		protected String doInBackground(String... args) {
//			String email = inputEmailAddress.getText().toString();
//			String content = inputMessage.getText().toString();
//			String from = MyApplication.getLoginVariable();
//
//			// Building Parameters
//			List<NameValuePair> params = new ArrayList<NameValuePair>();
//			params.add(new BasicNameValuePair("team_name", email));
//			params.add(new BasicNameValuePair("prod_desc", content));
//			params.add(new BasicNameValuePair("target_market", from));
//			params.add(new BasicNameValuePair("product_benefits", email));
//			params.add(new BasicNameValuePair("product_distribution", content));
//			params.add(new BasicNameValuePair("business_overview", from));
//			params.add(new BasicNameValuePair("product_service", email));
//			params.add(new BasicNameValuePair("market_analysis", content));
//			params.add(new BasicNameValuePair("market_strategy", from));
//			params.add(new BasicNameValuePair("finances", email));
//			params.add(new BasicNameValuePair("operations", content));
//			params.add(new BasicNameValuePair("budgeting_desc", from));
//			params.add(new BasicNameValuePair("financial_analysis", email));
//			params.add(new BasicNameValuePair("budgeting", content));
//			params.add(new BasicNameValuePair("bookkeeping", from));
//			params.add(new BasicNameValuePair("business_mgt", email));
//			params.add(new BasicNameValuePair("project_mgt", content));
//			params.add(new BasicNameValuePair("financial_mgt", from));
//			params.add(new BasicNameValuePair("hrm_training", email));
//			params.add(new BasicNameValuePair("special_training", email));
//
//
//			// getting JSON Object
//			// Note that create product url accepts POST method
//			JSONObject json = jsonParser.makeHttpRequest(url_send_message,
//					"POST", params);
//			
//			// check log cat fro response
//			Log.d("Create Response", json.toString());
//
//			// check for success tag
//			try {
//				int success = json.getInt(TAG_SUCCESS);
//
//				if (success == 1) {
//					// successfully created product
//					Intent i = new Intent(getApplicationContext(), NewSedaTeamProposalActivity.class);
//					startActivity(i);
//					
//					// closing this screen
//					finish();
//				} else {
//					// failed to create product
//				}
//			} catch (JSONException e) {
//				e.printStackTrace();
//			}
//
//			return null;
//		}
//
//		/**
//		 * After completing background task Dismiss the progress dialog
//		 * **/
//		protected void onPostExecute(String file_url) {
//			// dismiss the dialog once done
//			pDialog.dismiss();
//		}

//	}
//}
